iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 6
0
Security

點錯遊戲的我也只好硬著頭皮上了 系列 第 6

[基本技巧] strings - 非文字檔也能搜尋

  • 分享至 

  • xImage
  •  

「What do you suppose an ancient, advanced , and secretive organization like the Name less could want?.」
「The usual? Money. Power.」
「It’s true many organizations do unscrupulous things for wealth and influence. The Nameless, on the other hand, seem to care for none of these things.」
「Then what do they want?」
「We don’t know.」
「All we know is that they are behind a strange collection of unexplained phenomena dating back to… at least the Dark Ages.」
「Phenomena?」
「Certain Yeti sightings, most SETI signals, what urban legends call “the Hum”. It’s all them.」
「They engineer Yeti sightings??」
「Among other things. Perhaps they just want to make the world.」
「And how do you know all the about then?」
「I thought that was obvious. I hacked them, of course, my team and I, together. And now, you’re helping us, from the inside.」

05. strings it

Can you find the flag in file without running it? You can also find the file in /problems/strings-it_5_1fd17da9526a76a4fffce289dee10fbb on the shell server.
你有辦法不執行檔案就找到藏在裡面的 flag 嗎? 目標可執行檔可以在 sell 伺服器中的以下路徑找到 :/problems/strings-it_5_1fd17da9526a76a4fffce289dee10fbb
https://ithelp.ithome.com.tw/upload/images/20200920/20103688nhu0J3MDiS.png

WRITEUPS:

首先我們打開 shell ,進入該目錄後查看檔案目錄

cd /problems/strings-it_5_1fd17da9526a76a4fffce289dee10fbb
ls -la
total 836
drwxr-xr-x   2 root       root           4096 Sep 28  2019 .
drwxr-x--x 684 root       root          69632 Oct 10  2019 ..
-rwxr-sr-x   1 hacksports strings-it_5 776032 Sep 28  2019 strings

發現一個執行檔 strings ,執行後畫面顯示

./strings
Maybe try the 'strings' function? Take a look at the man page

提示我們使用 strings 的功能,因此先輸入以下指令查看使用說明

strings --h

man strings
STRINGS(1)                                                          GNU Development Tools                                                          STRINGS(1)

NAME
       strings - print the strings of printable characters in files.

SYNOPSIS
       strings [-afovV] [-min-len]
               [-n min-len] [--bytes=min-len]
               [-t radix] [--radix=radix]
               [-e encoding] [--encoding=encoding]
               [-] [--all] [--print-file-name]
               [-T bfdname] [--target=bfdname]
               [-w] [--include-all-whitespace]
               [-s] [--output-separatorsep_string]
               [--help] [--version] file...

DESCRIPTION
       For each file given, GNU strings prints the printable character sequences that are at least 4 characters long (or the number given with the options
       below) and are followed by an unprintable character.

       Depending upon how the strings program was configured it will default to either displaying all the printable sequences that it can find in each file,
       or only those sequences that are in loadable, initialized data sections.  If the file type in unrecognizable, or if strings is reading from stdin then
       it will always display all of the printable sequences that it can find.

       For backwards compatibility any file that occurs after a command line option of just - will also be scanned in full, regardless of the presence of any
       -d option.

       strings is mainly useful for determining the contents of non-text files.

從說明得知 strings 這個指令可用來找出非文字檔裡的可列印字元。只要再配合 grep 即可找出 flag

strings ./strings | grep "picoCTF"
picoCTF{5tRIng5_1T_dd38f284}

ANSWER:

picoCTF{5tRIng5_1T_dd38f284}


上一篇
[基本技巧] grep - 關鍵字搜尋
下一篇
[基本技巧] net cat - 網路版 cat,連接網路兩端的讀寫工具
系列文
點錯遊戲的我也只好硬著頭皮上了 30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言